home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
a_utils
/
_archvrs
/
unix
/
comp430
/
readme4.3
< prev
next >
Wrap
Text File
|
1990-01-17
|
17KB
|
331 lines
$@(#) compress readme4.3 90/01/18 03:00:00 don Release ^
Compress version 4.3 changes:
(01/18/90)
Found and corrected a problem with decompression. If there is a character
that repeats more that 128k time, then it would over-run the token buffer.
Made token buffer in decompress() dynamic.
(01/06/90)
Corrected compiler anomoly on some systems. First reported with compiling
compress on the Tandy 6000 computer with the 3.2 development system. It
appears that the compiler sign extends regardless of cast on certain
operations. This caused the program to fail after the shift to 16 bits. It
would eventually address memory outside of its space. A quick test if your
compiler has this problem is to compile with DEBUG and NOSIGNAL defined. The
result will be a bad token on decompress AND a core dump on signal 0x1a
on compress. So far only cpu's in the 68000 family and certain compilers
exhibit this anomoly. It is corrected in this release. If the correction
does not seem to work for your system, please contact the author.
(12/25/89)
Corrected pointer dereference in error reporting.
(10/02/89)
Changed the many #ifndef NDEBUG to #ifdef DEBUG. It was pointed out that
the double negative sometimes makes tracking code less clear. Compiling
the program with neither NDEBUG or DEBUG defined will default to a
debug included version. If -DNDEBUG is defined on compile, then the
debugging code is left out. Defining -DDEBUG is an essential no op, since
it defaults to on. The test for this was added to compress.h.
(9/09/89)
Due to requests on the file testing logic, the test for linkages is now
done before compression. Before, it was done after the compression and if
a file was linked, the compress was aborted. Wasted processing time for
an essential no-op.
The defines for various models and system binaries was getting horendous
with each added port. Now there is a define added to make the port name in
the compress.h file. The version() function has been cleaned up a lot for
that.
Included a new define to include or exclude the code for processing the
-I and -O path options. These options are nice for many purposes, and expansion
of the original specs for compress. However, they are added code for those
who use scripts that don't access these abilities. They can be excluded to
make the utility smaller.
NOTE! The new btoa utility is backward compatible, but as distributed
will not make files that are usable with the old utility. So a slightly
ported btoa is again included with this compress shar archive. This archive
now includes all the old scripts for tarmail, etc. Installation instructions
are separated out in the file Installation. This is for those who have not
used compress before and are confused on the various files and linkages
to make the package work.
(5/20/89)
NOTE! As there is now a new btoa utility on usenet that is backward
compatible with the old one, the source code for the old btoa/atob
is no longer provided with compress.
(5/20/89 -- incorportated changes for Minix version port. These changes
were made by Dale Schumacher. The following information on these changes
were submitted by Dale:
The enclosed files are the COMPRESS v4.3 file compression utility
with modifications to compile Minix-ST v1.1 with the ACK compiler.
This version supports compression/decompression with up to 16 bits.
It probably WON'T work (at least for >13 bit compression) under
Minix-PC.
Dale Schumacher
bungia!midgard.mn.org!syntel!dal -or- dal@syntel.UUCP
Notes on compilation with Sozobon C:
There are several instances of the '#if defined()' pre-processor
directive scattered through the code. I've converted all such
references to standard '#ifdef' or '#ifndef' directives, which is
consistent with most of the existing code.
Notes on the port to MINIX-ST:
The get_one() function fails because MINIX won't support the dubious
practice of reading from fd=2 (aka stderr). Instead, "/dev/tty" is
opened and read from directly. This may not be the best way to handle
this problem, but it works. I took the example from the Minix
distribution sources (compress.c,v 4.1 85/12/05 09:00:00 kent).
The defaults for the version of compress which was supplied with the
MINIX-ST 1.1 distribution are apparently quite different from those
of current Unix implementations. I've added a compile-time switch
to allow 'verbose' to be default TRUE. I've also taken advantange
of the switch for making 'keep source' also default TRUE. The comments
in the code imply that both of these options are typically defaulted
to FALSE, but I've chosen to remain as close to the original compress
as possible. Similarly, the default number of bits to use is 13,
although up to 16 will work properly.
In order to do 16-bit compression, you must "chmem =400000 compress".
If you still get a "not enough memory to compress" error, bump the
chmem value up a bit more. If you only want to use 13 bits maximum
for compression, "chmem =65000" seems to be sufficient. Decompression
takes far less space, so 16-bit decompression can be done even with
the smaller chmem value. You may even be able to make the value
smaller and still do decompression, but the initial value from the
compiler of about 45000 is not large enough to compress with 13 bits.
Just for peace-of-mind, I have verified that this compress can
decompress files created with the original compress, and the
original compress can decompress files created with this new
compress, as long as you don't use more than 13 bits (of course).
=============== end of Dale's notes ================
None to the basic algorithm. Fixed some bugs of where the output files should
go. Fixed bug with file name > 12 characters. Fixed problem with Atari ST
version. Made ready for release on usenet.
Compress version 4.2 changes:
Put adaptive reset back in this version. However, including it is controlled
by the COMP40 define. The reason for this is that large files that get to
the highest maxbit will not compress as small as the current version 4.0.
However, they are completely compatible on decompress. If you define COMP40
it will include the code for adaptive reset of the tables. However, it will
slow processing time down somewhat. So the decision on speed or size is the
user's. The source code is compiled for default of speed; i.e. COMP40 is not
defined.
Caught some last minute bugs with unix version. Cleaned up for public
release. Version appears very stable at this point. Found the rest of the
if defined() structs.
The full package for compress also includes shell scripts for compressdir,
uncompressdir, tarmail, untarmail, etc. These can be found in the
Compress 4.0 mod.sources (part 2 of 2). Btoa and Atob source code were
modified and included as the original did not compile properly on some
machines.
Compress.man is a formatted manual page reflecting the 4.2 compress.
Compress.1 is a nroff formatted manual page.
(On Compuserve Unixforum, they are included in the library file compr2.sh)
(In the compress.zoo file the compr2.sh file is added for those who need
it. It is in unix line format. The rest of the files need to be converted
to run properly on unix. The text files should be processed as follows:
tr -d '\015' <file_name >file_name.n
mv file_name.n file_name
Compress version 4.1f changes:
Thanks to Jim Boys for trying out a lot of options and compiling and
recompiling compress for most of a day. Because of this, xenix version now
compiles and runs properly. Xenix system 2.2.1. Refined macros in compapi.c
and adjusted for some implementations use of int instead of void for signal().
Thanks to Noel Bergman for testing under os/2. Changes made to the error and
unlinking routines led to a more robust coding.
Compress version 4.1e changes:
The program now compiles with all Unix compress defaults. This means that
existing scripts for unix compress will work as expected. For msdos users,
this means that entering the command alone will wait for input. It works as a
straight filter program now. Without command line options it expects
redirection. You can still use -h or -? to view the command options.
Also, the input files are now unlinked, as expected on the unix system. This
is done on successful completion of compress and uncompress. On Zcat, no
unlinking takes place.
Other changes have been in the makefile and fine tuning the header and source
to be more compatible with more compilers. Some errant casts have been taken
care of.
Compress version 4.1d improvements:
o Improved the interface some more. Some files were being unlinked
when errors were discovered. Changed testing for enough memory for
expansion/compression.
o The compressed files are totally compatible with the existing
implementation of compress v.4 joe release.
Note, the header file and the make files need some work for other compilers
and operating systems. Please leave me a messsage via the contact information
at the end of this file. I need to know specific system dependent functions
and header files to make compiling easier.
COMPRESS file compression utility for various computer operating systems. This
version of the source code keeps to the existing program calling conventions
of the Unix version, generates compatible compressed files and will uncompress
Unix files up to 16 bit compression. The reason for this project was first to
port to the MSDOS environment.
Later on, Lyle Rains worked on the compression and decompression routines. Not
only did he optimize them a great deal, it now is able to keep tables in 64K
chunks. This is essential on segmented address machines, both to keep the use
of huge pointers out of the program and eliminate the need for 32 bit
arithmetic. Another effect of these changes is that the limitation on bits is
not dependent on 16 bit cpu's.
Finally, this code is released with the expectation that it will compile on
any platform that uses a C language compiler. However, during testing, we
only had access to some systems. We would appreciate any comments regarding
changes needed to compile properly on different operating system platforms.
The philosophy behind splitting up the source code as it is, is to make
porting and upgrading more easily done. The main logic involved in the
utility is in compress.c, this also tests all the files and options, and opens
any needed files by freopens() to stdin and stdout. The initial reads or
writes are done to the file, and the files are passed to the API for the
actual compression and decompression. The compusi.c module is support for the
interupt routines and the various functions to deal with file naming
conventions.
Modified atob.c btoa.c source code is included. The original did not cast
constants to longs and thus had bad code output with some compilers. Now
fixed. Also, on some operating systems, you can not unlink a file and continue
to use the file. This would cause lost clusters. The unlinking of the temp
file is now done at the end of the program.
You should look closely at the COMPRESS.H file to see what defines you will
need for your system. The COMPAPI.C file is fairly standard and should have
no problems with most current compilers. There are two User System Interface
files:
COMPUSI.UNI is for unix/xenix system and compiler. Since it is a unix
like operating system, that is the file that should be renamed to
compusi.c for compiling. The major things to check for on this port
are the signal calls, to make sure they are appropriate for your
system.
COMPUSI.DOS is for the MS/PCDOS operating system. The system's
path and naming conventions are the particular concern here. Also
check on the signal() calls. Microsoft C version 5.1 was the
compiler it was written for. In version 4.0, one of the signal
defines is not supported. Please check your compiler's documentation
for compatibility. The other problem may be some of the string
routines. They are ANSI compatible and the compilers we used to
test it supported them. However, you may have to rewrite the
functions. Atari ST, with the Mark Williams Compiler support was
added.
For the most part, COMPRESS.C uses very standard library functions, or
calls system specific functions from the compusi.c file. You should read the
header file to decide which defines your system needs. Also rename either
compusi.uni or compusi.dos as a starting point. The major differences is their
support of operating system directory naming conventions. You may have to
change some of the code. If you port the compusi.xxx to another operating
system, we would appreciate a copy of the file to include in the distribution.
Compiling: Please see the make files included for various compilers and
systems. Use your compiler's optimizing switch for maximum optimization. If
you have a problem, first turn the optimizing off and see if the program
works. If you still have a problem, let us know.
For segmented addressing machines, 16 bit varieties, the program was designed
to run compiled with near code and data, but far pointers for the compression
and decompression buffers. These are allocated in COMPUSI.C using emalloc()
function. You may (probably will) have to change your compiler's name for
the routine that allocates far pointers. If you can't, then you must compile
the program in the compact model with far pointers as a default.
INSTALLATION: The program reads it's own name in most implementations.
If it doesn't, (Versions of MSdos less than 3.x are one), then you must
use command line options to decompress or 'cat' files. Otherwise, if your
system allows filename links, as in Unix/Xenix, do something like the after
compilation, move "compress" to a standard executable location, such as
/usr/local and link under uncompress and zcat. Thus:
mv compress /usr/local
cd /usr/local
ln compress uncompress
ln compress zcat
If you are using MSDOS version 3.x, then copy compress.exe to uncomp.exe and
to zcat.exe. Once this is done, the program will understand it's default
operating options.
To get all the options and what the current defaults are, use the command:
compress -h
Compress version 4.10b : Combined effort by Lyle Rains and Don Gloistein.
Now should be useful on both MsDos machines and Unix platforms. If there are
portability problems with compiling on Unix, please contact me with the
portability issues.
o See the source and header files for other bug swats.
o Added some defines to accomodate various compilers and operating
systems. Attempted to keep the coding compatible with the current
ANSI standards.
o Fixed my bug in detecting extension if the '.' character is used in the
MsDos system.
o Lyle Rains' work on a modified algorithm for compression and
decompression is incorporated. This will change some file sizes and the
final code of some compressed files. But don't worry. Either the
existing compress v4 or this one will decompress the file. The reason
for the difference is that the compression ratio is not checked in this
version. It saves time in compression with, we feel, minimum sacrifice
to compression.
o Xenix should be able to compile it as is now.
o Various unix systems should be able to compile it with minimum changes
to the code. Use the COMPUSI.UNI as the starting point. The other
changes should be evident in the COMPRESS.H file. PLEASE READ THAT FILE
BEFORE COMPILING.
Note: The following comments and history are provided for background. This
implementation changes much of the Dos information. The archive file
containing this source code also contains the following program sources:
btoa - convert binary to ascii for mailing
atob - convert ascii to binary with checksum
regards,
don
Please contact me if you have suggestions, comments or bug reports. I can
be reached by the following:
Full-Name: Donald Gloistein
US Mail: DGWare Consulting; P.O. Box 669, Alvin, TX 77512-0669
CompuServe: Unixforum 76010,474
Phone: (713)331-9372
UUCP: Pete Holsberg has agreed to receive uucp mail for us. You may
reach Lyle or myself via:
!rutgers!princeton!mccc!pjh